#pragma once

#include <set>

class IObserver;
class IObservable;

class IObservable {
public:
	IObservable(int observabletype); // Pass in your object type in here.
	virtual ~IObservable();

	// Nobody wants RTTI. So I made mine.
	int GetObservableType() const;

	int RegisterObserver(IObserver* obs);
	int UnregisterObserver(IObserver* obs);

	int NotifyObservers(void* argument);

protected:
	const int _observabletype;

private:
	std::set<IObserver*> m_Observing;
};


class IObserver {
public:
	IObserver() {}
	virtual ~IObserver() {}

	virtual int Notify(IObservable* from, void* argument) = 0;
};
